package yxy.game.pm2.command.soloride;

import yxy.cherry.game.base.message.MessageEmitterHandler;
import yxy.cherry.game.base.message.annotation.MessageSource;
import yxy.cherry.game.base.message.annotation.MessageType;
import yxy.game.pm2.Result;
import yxy.game.pm2.command.Command;
import yxy.game.pm2.message.SoloRideMessage;

/** 千里走单骑 千里走单骑排行榜膜拜 */
@MessageType(proto = Command.SoloRideRankWorship, classtype = SoloRideMessage.SoloRideRankWorshipRequest.class)
public class CMD_SoloRideRankWorship extends Command<SoloRideMessage.SoloRideRankWorshipRequest> {

	@Override
	public void execute(MessageSource messageSource, SoloRideMessage.SoloRideRankWorshipRequest request) {
		String playerCode = messageSource.getTag();
		// TODO 处理请求参数

		SoloRideMessage.SoloRideRankWorshipResponse.Builder response = SoloRideMessage.SoloRideRankWorshipResponse.newBuilder();

		// TODO 处理响应封装

		send(messageSource, response, Result.Success);
	}

	private void send(MessageSource messageSource, SoloRideMessage.SoloRideRankWorshipResponse.Builder response, Result result) {
		response.setResult(result.packResult());
		MessageEmitterHandler.getInstance().send(messageSource, response.build());
	}
}